home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / utilit~1 / gdb35src.zoo / dist-gdb / infrun.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1993-03-03  |  44.3 KB  |  4,505 lines

  1. # 1 "infrun.c"
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.    
  116.  
  117.    
  118.    
  119.  
  120. # 1 "u:\\c\\gnu\\include\\stdio.h" 1
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131. # 1 "u:\\c\\gnu\\include\\compiler.h" 1
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.          
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177. # 54 "u:\\c\\gnu\\include\\compiler.h"
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185. # 69 "u:\\c\\gnu\\include\\compiler.h"
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195. # 98 "u:\\c\\gnu\\include\\compiler.h"
  196.  
  197.  
  198. # 115 "u:\\c\\gnu\\include\\compiler.h"
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.       
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238. # 167 "u:\\c\\gnu\\include\\compiler.h"
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254. # 11 "u:\\c\\gnu\\include\\stdio.h" 2
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264. typedef unsigned long   size_t;
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.              
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310. typedef    struct             
  311.     {
  312.     long        _cnt;         
  313.     unsigned char    *_ptr;         
  314.     unsigned char    *_base;         
  315.     unsigned int    _flag;         
  316.     int        _file;         
  317.     long        _bsiz;         
  318.     unsigned char    _ch;         
  319.     }
  320.     FILE;
  321.  
  322.  
  323. typedef unsigned long fpos_t;
  324.  
  325.  
  326.  
  327.  
  328. extern    FILE    _iob[];
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340.  
  341.  
  342.  
  343.  
  344.   int    remove    (const char *) ;
  345.   int    rename    (const char *, const char *) ;
  346.   char *    tmpnam    (char *) ;
  347.   FILE *    tmpfile    (void) ;
  348.  
  349.   int    fclose    (FILE *) ;
  350.   int    fflush    (FILE *) ;
  351.  
  352.   FILE *    fopen    (const char *, const char *) ;
  353.   FILE *    freopen    (const char *, const char *, FILE *) ;
  354.  
  355.   void    setbuf    (FILE *, char *) ;
  356.   int    setvbuf    (FILE *, char *, int, size_t) ;
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.   int  fscanf  (FILE *, const char *, ...) ;
  364.   int  scanf   (const char *, ...) ;
  365.   int  sscanf  (const char *, const char *, ...) ;
  366.  
  367.  
  368.   int    fprintf    (FILE *, const char *, ...) ;
  369.   int    printf    (const char *, ...) ;
  370.   int    sprintf    (char *, const char *, ...) ;
  371.  
  372.   int     vfprintf (FILE *, const char *, char * ) ;
  373.   int     vprintf     (const char *, char * ) ;
  374.   int     vsprintf (char *, const char *, char * ) ;
  375.  
  376.   int    fgetc    (FILE *) ;
  377.   char    *fgets    (char *, int, FILE *) ;
  378.   char    *gets    (char *) ;
  379.   int    fputc    (int c, FILE *) ;
  380.   int    fputs    (const char *, FILE *) ;
  381.   int    puts    (const char *) ;
  382.   int     fungetc    (int, FILE *) ;
  383.  
  384.   size_t    fread    (void *, size_t, size_t, FILE *) ;
  385.   size_t    fwrite    (const void *, size_t, size_t, FILE *) ;
  386.  
  387.   int    fgetpos    (FILE *, fpos_t *) ;
  388.   int    fsetpos    (FILE *, fpos_t *) ;
  389.  
  390.   int    fseek    (FILE *, long, int) ;
  391.   long    ftell    (FILE *) ;
  392.   void    rewind    (FILE *) ;
  393.  
  394.   void    perror    (const char *) ;
  395.  
  396.  
  397.   FILE    *fdopen    (int, const char *) ;
  398.   FILE    *popen    (const char *, const char *) ;
  399.   int    pclose    (FILE *) ;
  400.  
  401.  
  402.   void    _binmode    (int) ;         
  403.   long     getl    (FILE *) ;
  404.   long     putl    (long, FILE *) ;
  405.   short     getw    (FILE *) ;
  406.   short     putw    (short, FILE *) ;
  407.  
  408.  
  409.  
  410.  
  411.  
  412.  
  413.  
  414.   int    _filbuf    (FILE *) ;     
  415.  
  416.  
  417.  
  418. # 182 "u:\\c\\gnu\\include\\stdio.h"
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434. # 119 "infrun.c" 2
  435.  
  436. # 1 "defs.h" 1
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461. extern char *savestring ();
  462. extern char *concat ();
  463. extern char *xmalloc (), *xrealloc ();
  464. extern int parse_escape ();
  465. extern char *reg_names[];
  466.  
  467.  
  468.  
  469.  
  470.  
  471.  
  472.  
  473.  
  474.  
  475.  
  476.  
  477.  
  478. extern int quit_flag;
  479.  
  480. extern int immediate_quit;
  481.  
  482.  
  483.  
  484.  
  485.  
  486.  
  487. enum command_class
  488. {
  489.   no_class = -1, class_run = 0, class_vars, class_stack,
  490.   class_files, class_support, class_info, class_breakpoint,
  491.   class_alias, class_obscure, class_user,
  492. };
  493.  
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504. struct cleanup
  505. {
  506.   struct cleanup *next;
  507.   void (*function) ();
  508.   int arg;
  509. };
  510.  
  511. extern void do_cleanups ();
  512. extern void discard_cleanups ();
  513. extern struct cleanup *make_cleanup ();
  514. extern struct cleanup *save_cleanups ();
  515. extern void restore_cleanups ();
  516. extern void free_current_contents ();
  517. extern void reinitialize_more_filter ();
  518. extern void fputs_filtered ();
  519. extern void fprintf_filtered ();
  520. extern void printf_filtered ();
  521. extern void print_spaces_filtered ();
  522. extern char *tilde_expand ();
  523.  
  524.  
  525.  
  526.  
  527. struct command_line
  528. {
  529.   struct command_line *next;
  530.   char *line;
  531. };
  532.  
  533. struct command_line *read_command_lines ();
  534.  
  535.  
  536.  
  537. char *current_directory;
  538.  
  539. # 120 "infrun.c" 2
  540.  
  541. # 1 "param.h" 1
  542.  
  543.  
  544.  
  545.  
  546.  
  547.  
  548.  
  549.  
  550.  
  551.  
  552.  
  553.  
  554.  
  555.  
  556.  
  557.  
  558.  
  559.  
  560.  
  561.  
  562.  
  563.  
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.  
  602.  
  603.  
  604.  
  605.  
  606.  
  607.  
  608.  
  609.  
  610.  
  611.  
  612.  
  613.  
  614.  
  615.  
  616.  
  617.  
  618.  
  619.  
  620.  
  621.  
  622.  
  623.  
  624.  
  625.  
  626.  
  627.  
  628.  
  629.  
  630.  
  631.  
  632.  
  633.  
  634.  
  635.  
  636.  
  637.  
  638.  
  639.  
  640.  
  641.  
  642.  
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.  
  668.  
  669.  
  670.  
  671.  
  672.  
  673.  
  674.  
  675.  
  676.  
  677.  
  678.  
  679.  
  680.  
  681.  
  682.  
  683.  
  684.  
  685.  
  686.  
  687.  
  688.  
  689.  
  690.  
  691.  
  692.  
  693.  
  694.  
  695.  
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733.  
  734.  
  735.  
  736.  
  737.  
  738.  
  739.  
  740.  
  741.  
  742.  
  743.  
  744.  
  745.  
  746.  
  747.  
  748.  
  749.  
  750.  
  751.  
  752.  
  753.  
  754.  
  755.  
  756.  
  757.  
  758.  
  759.  
  760.  
  761.  
  762.  
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.  
  800.  
  801.  
  802.  
  803.  
  804.  
  805.  
  806.  
  807.  
  808.  
  809. # 281 "param.h"
  810.  
  811.  
  812.  
  813.  
  814.  
  815.  
  816.  
  817.  
  818.  
  819.  
  820.  
  821.  
  822.  
  823. # 340 "param.h"
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830. # 355 "param.h"
  831.  
  832.  
  833.  
  834.  
  835. # 378 "param.h"
  836.  
  837.  
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.  
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864.  
  865.  
  866.  
  867.  
  868.  
  869.  
  870.  
  871.  
  872.  
  873.  
  874.  
  875.  
  876.  
  877.  
  878.  
  879.  
  880.  
  881.  
  882.  
  883.  
  884.  
  885.  
  886.  
  887.  
  888.  
  889.  
  890.  
  891.  
  892.  
  893.  
  894.  
  895.  
  896.  
  897.  
  898.  
  899.  
  900.  
  901.  
  902.  
  903.  
  904.  
  905.  
  906.  
  907.  
  908.  
  909.  
  910.  
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922. # 121 "infrun.c" 2
  923.  
  924. # 1 "symtab.h" 1
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.  
  932.  
  933.  
  934.  
  935.  
  936.  
  937.  
  938.  
  939.  
  940.  
  941.  
  942.  
  943.  
  944. # 1 "u:\\c\\gnu\\include\\obstack.h" 1
  945.  
  946.  
  947.  
  948.  
  949.  
  950.  
  951.  
  952.  
  953.  
  954.  
  955.  
  956.  
  957.  
  958.  
  959.  
  960.  
  961.  
  962.  
  963.  
  964.  
  965.  
  966.  
  967.  
  968.  
  969.  
  970.  
  971.  
  972.  
  973.  
  974.  
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.  
  998.  
  999.  
  1000.  
  1001.  
  1002.  
  1003.  
  1004.  
  1005.  
  1006.  
  1007.  
  1008.  
  1009.  
  1010.  
  1011.  
  1012.  
  1013.  
  1014.  
  1015.  
  1016.  
  1017.  
  1018.  
  1019.  
  1020.  
  1021.  
  1022.  
  1023.  
  1024.  
  1025.  
  1026.  
  1027.  
  1028.  
  1029.  
  1030.  
  1031.  
  1032.  
  1033.  
  1034.  
  1035.  
  1036.  
  1037.  
  1038.  
  1039.  
  1040.  
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.              
  1053.  
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.  
  1061.  
  1062.  
  1063.  
  1064.  
  1065.  
  1066.  
  1067.  
  1068.  
  1069.  
  1070. struct _obstack_chunk         
  1071. {
  1072.   char  *limit;             
  1073.   struct _obstack_chunk *prev;     
  1074.   char    contents[4];         
  1075. };
  1076.  
  1077. struct obstack         
  1078. {
  1079.   size_t chunk_size;         
  1080.   struct _obstack_chunk* chunk;     
  1081.   char    *object_base;         
  1082.   char    *next_free;         
  1083.   char    *chunk_limit;         
  1084.   long    temp;             
  1085.   int   alignment_mask;         
  1086.   struct _obstack_chunk *(*chunkfun) (size_t) ;  
  1087.   void (*freefun) (struct _obstack_chunk*) ;     
  1088.    
  1089.  
  1090.  
  1091.   char  maybe_empty_object;
  1092. };
  1093.  
  1094.  
  1095.  
  1096.  
  1097. extern void _obstack_newchunk (struct obstack *, size_t);
  1098. extern void _obstack_free (struct obstack *, void *);
  1099. extern void _obstack_begin (struct obstack *, size_t, int,
  1100.                 void *(*) (), void (*) ());
  1101.  
  1102.  
  1103.  
  1104.  
  1105.  
  1106.  
  1107.  
  1108.  
  1109.  
  1110.  
  1111.  
  1112. void obstack_init (struct obstack *obstack);
  1113.  
  1114. void * obstack_alloc (struct obstack *obstack, size_t size);
  1115.  
  1116. void * obstack_copy (struct obstack *obstack, void *address, size_t size);
  1117. void * obstack_copy0 (struct obstack *obstack, void *address, size_t size);
  1118.  
  1119. void obstack_free (struct obstack *obstack, void *block);
  1120.  
  1121. void obstack_blank (struct obstack *obstack, size_t size);
  1122.  
  1123. void obstack_grow (struct obstack *obstack, void *data, size_t size);
  1124. void obstack_grow0 (struct obstack *obstack, void *data, size_t size);
  1125.  
  1126. void obstack_1grow (struct obstack *obstack, int data_char);
  1127. void obstack_ptr_grow (struct obstack *obstack, void *data);
  1128. void obstack_int_grow (struct obstack *obstack, int data);
  1129. void obstack_long_grow (struct obstack *obstack, long data);
  1130.  
  1131. void * obstack_finish (struct obstack *obstack);
  1132.  
  1133. size_t obstack_object_size (struct obstack *obstack);
  1134.  
  1135. size_t obstack_room (struct obstack *obstack);
  1136. void obstack_1grow_fast (struct obstack *obstack, int data_char);
  1137. void obstack_ptr_grow_fast (struct obstack *obstack, void *data);
  1138. void obstack_int_grow_fast (struct obstack *obstack, int data);
  1139. void obstack_blank_fast (struct obstack *obstack, size_t size);
  1140.  
  1141. void * obstack_base (struct obstack *obstack);
  1142. void * obstack_next_free (struct obstack *obstack);
  1143. int obstack_alignment_mask (struct obstack *obstack);
  1144. size_t obstack_chunk_size (struct obstack *obstack);
  1145.  
  1146.  
  1147.  
  1148.  
  1149.  
  1150.  
  1151.  
  1152.  
  1153.  
  1154.  
  1155.  
  1156.  
  1157.  
  1158.  
  1159.  
  1160.  
  1161.  
  1162.  
  1163.  
  1164.  
  1165.  
  1166.  
  1167.  
  1168.  
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195.  
  1196.  
  1197.  
  1198.  
  1199.  
  1200.  
  1201.  
  1202.  
  1203.  
  1204.  
  1205.  
  1206.  
  1207.  
  1208. # 272 "u:\\c\\gnu\\include\\obstack.h"
  1209.  
  1210.  
  1211. # 283 "u:\\c\\gnu\\include\\obstack.h"
  1212.  
  1213.  
  1214.  
  1215.  
  1216.  
  1217.  
  1218.  
  1219.  
  1220.  
  1221.  
  1222.  
  1223.  
  1224.    
  1225.  
  1226.  
  1227.  
  1228.  
  1229.  
  1230.  
  1231.  
  1232.  
  1233.  
  1234.  
  1235.  
  1236.  
  1237.  
  1238.  
  1239.  
  1240.  
  1241.  
  1242.  
  1243.  
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.  
  1261.  
  1262.  
  1263.  
  1264.  
  1265.  
  1266.  
  1267.  
  1268.  
  1269.  
  1270.  
  1271.  
  1272.  
  1273.  
  1274.  
  1275.  
  1276.  
  1277.  
  1278.  
  1279.  
  1280.  
  1281.  
  1282.  
  1283. # 367 "u:\\c\\gnu\\include\\obstack.h"
  1284.  
  1285.  
  1286.  
  1287.  
  1288.  
  1289.  
  1290.  
  1291.  
  1292.  
  1293.  
  1294.  
  1295. # 470 "u:\\c\\gnu\\include\\obstack.h"
  1296.  
  1297.  
  1298.  
  1299. # 20 "symtab.h" 2
  1300.  
  1301.  
  1302.  
  1303.  
  1304.  
  1305.  
  1306.  
  1307. extern struct obstack *symbol_obstack;
  1308. extern struct obstack *psymbol_obstack;
  1309.  
  1310.  
  1311.  
  1312.  
  1313. extern char *xmalloc ();
  1314. extern void free ();
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325.  
  1326.  
  1327.  
  1328.  
  1329.  
  1330. enum misc_function_type {mf_unknown = 0, mf_text, mf_data, mf_bss, mf_abs};
  1331.  
  1332. struct misc_function
  1333. {
  1334.   char *name;
  1335.   unsigned int  address;
  1336.   unsigned char type;         
  1337. };
  1338.  
  1339.  
  1340.  
  1341. struct misc_function *misc_function_vector;
  1342. int misc_function_count;
  1343.  
  1344. # 1 "symseg.h" 1
  1345.  
  1346.  
  1347.  
  1348.  
  1349.  
  1350.  
  1351.  
  1352.  
  1353.  
  1354.  
  1355.  
  1356.  
  1357.  
  1358.  
  1359.  
  1360.  
  1361.  
  1362.  
  1363.  
  1364.  
  1365.  
  1366.  
  1367.  
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.  
  1394.  
  1395.  
  1396.  
  1397.  
  1398.  
  1399.  
  1400.  
  1401.  
  1402.  
  1403.  
  1404.  
  1405.  
  1406.  
  1407.  
  1408.  
  1409.  
  1410.  
  1411.  
  1412.  
  1413.  
  1414. enum language {language_c};
  1415.  
  1416. struct symbol_root
  1417. {
  1418.   int format;             
  1419.   int length;             
  1420.   int ldsymoff;             
  1421.   int textrel;             
  1422.   int datarel;             
  1423.   int bssrel;             
  1424.   char *filename;         
  1425.   char *filedir;         
  1426.   struct blockvector *blockvector;  
  1427.   struct typevector *typevector;  
  1428.   enum language language;     
  1429.   char *version;         
  1430.   char *compilation;         
  1431.   int databeg;             
  1432.   int bssbeg;             
  1433.   struct sourcevector *sourcevector;  
  1434. };
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  
  1440.  
  1441. struct typevector
  1442. {
  1443.   int length;             
  1444.   struct type *type[1];
  1445. };
  1446.  
  1447.  
  1448.  
  1449. enum type_code
  1450. {
  1451.   TYPE_CODE_UNDEF,         
  1452.   TYPE_CODE_PTR,         
  1453.   TYPE_CODE_ARRAY,         
  1454.   TYPE_CODE_STRUCT,         
  1455.   TYPE_CODE_UNION,         
  1456.   TYPE_CODE_ENUM,         
  1457.   TYPE_CODE_FUNC,         
  1458.   TYPE_CODE_INT,         
  1459.   TYPE_CODE_FLT,         
  1460.   TYPE_CODE_VOID,         
  1461.   TYPE_CODE_SET,         
  1462.   TYPE_CODE_RANGE,         
  1463.   TYPE_CODE_PASCAL_ARRAY,     
  1464.  
  1465.    
  1466.   TYPE_CODE_MEMBER,         
  1467.   TYPE_CODE_METHOD,         
  1468.   TYPE_CODE_REF,         
  1469. };
  1470.  
  1471.  
  1472.  
  1473.  
  1474.  
  1475.  
  1476.  
  1477.  
  1478.  
  1479.  
  1480.  
  1481.  
  1482.  
  1483.  
  1484.  
  1485.  
  1486.  
  1487.  
  1488.  
  1489.  
  1490.  
  1491.  
  1492.  
  1493.  
  1494. struct type
  1495. {
  1496.    
  1497.   enum type_code code;
  1498.    
  1499.  
  1500.  
  1501.   char *name;
  1502.    
  1503.   int length;
  1504.    
  1505.  
  1506.  
  1507.  
  1508.  
  1509.   struct type *target_type;
  1510.    
  1511.  
  1512.  
  1513.  
  1514.   struct type *pointer_type;
  1515.    
  1516.   struct type *reference_type;
  1517.   struct type **arg_types;
  1518.   
  1519.    
  1520.  
  1521.  
  1522.  
  1523.   struct type *function_type;
  1524.  
  1525.  
  1526.  
  1527.  
  1528.  
  1529.  
  1530.  
  1531.  
  1532.   struct type *main_variant, *next_variant;
  1533.  
  1534.    
  1535.   short flags;
  1536.    
  1537.   short nfields;
  1538.    
  1539.  
  1540.  
  1541.  
  1542.  
  1543.  
  1544.  
  1545.  
  1546.  
  1547.  
  1548.  
  1549.   struct field
  1550.     {
  1551.        
  1552.  
  1553.  
  1554.  
  1555.       int bitpos;
  1556.        
  1557.  
  1558.  
  1559.       int bitsize;
  1560.        
  1561.  
  1562.  
  1563.       struct type *type;
  1564.        
  1565.  
  1566.       char *name;
  1567.     } *fields;
  1568.  
  1569.    
  1570.   int *private_field_bits;
  1571.   int *protected_field_bits;
  1572.  
  1573.    
  1574.   short nfn_fields;
  1575.    
  1576.   short n_baseclasses;
  1577.  
  1578.    
  1579.  
  1580.   int nfn_fields_total;
  1581.  
  1582.    
  1583.  
  1584.  
  1585.  
  1586.   struct fn_fieldlist
  1587.     {
  1588.        
  1589.       char *name;
  1590.        
  1591.       int length;
  1592.        
  1593.       struct fn_field
  1594.     {
  1595.  
  1596.  
  1597.  
  1598.  
  1599.        
  1600.       struct type *type;
  1601.        
  1602.       struct type **args;
  1603.        
  1604.       char *physname;
  1605.        
  1606.  
  1607.       int voffset;
  1608.     } *fn_fields;
  1609.  
  1610.       int *private_fn_field_bits;
  1611.       int *protected_fn_field_bits;
  1612.  
  1613.     } *fn_fieldlists;
  1614.  
  1615.   unsigned char via_protected;
  1616.   unsigned char via_public;
  1617.  
  1618.    
  1619.  
  1620.  
  1621.  
  1622.  
  1623.  
  1624.  
  1625.  
  1626.   struct type *vptr_basetype;
  1627.  
  1628.   int vptr_fieldno;
  1629.  
  1630.    
  1631.  
  1632.  
  1633.  
  1634.  
  1635.  
  1636.  
  1637.  
  1638.  
  1639.   struct type **baseclasses;
  1640. };
  1641.  
  1642.  
  1643.  
  1644.  
  1645.  
  1646.  
  1647.  
  1648.  
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654.  
  1655.  
  1656.  
  1657.  
  1658.  
  1659.  
  1660.  
  1661.  
  1662.  
  1663.  
  1664.  
  1665.  
  1666.  
  1667.  
  1668. struct blockvector
  1669. {
  1670.    
  1671.   int nblocks;
  1672.    
  1673.   struct block *block[1];
  1674. };
  1675.  
  1676. struct block
  1677. {
  1678.    
  1679.  
  1680.  
  1681.  
  1682.   int startaddr, endaddr;
  1683.    
  1684.  
  1685.  
  1686.  
  1687.  
  1688.  
  1689.  
  1690.  
  1691.  
  1692.   struct symbol *function;
  1693.    
  1694.    
  1695.  
  1696.  
  1697.  
  1698.  
  1699.   struct block *superblock;
  1700.    
  1701.  
  1702.  
  1703.  
  1704.  
  1705.   unsigned char gcc_compile_flag;
  1706.    
  1707.   int nsyms;
  1708.    
  1709.   struct symbol *sym[1];
  1710. };
  1711.  
  1712.  
  1713.  
  1714.  
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720.  
  1721.  
  1722.  
  1723.  
  1724.  
  1725.  
  1726.  
  1727.  
  1728.  
  1729.  
  1730.  
  1731.  
  1732.  
  1733.  
  1734. enum namespace
  1735. {
  1736.   UNDEF_NAMESPACE, VAR_NAMESPACE, STRUCT_NAMESPACE, LABEL_NAMESPACE,
  1737. };
  1738.  
  1739.  
  1740.  
  1741. enum address_class
  1742. {
  1743.   LOC_UNDEF,         
  1744.   LOC_CONST,         
  1745.   LOC_STATIC,         
  1746.   LOC_REGISTER,         
  1747.   LOC_ARG,         
  1748.   LOC_REF_ARG,         
  1749.              
  1750.   LOC_REGPARM,         
  1751.   LOC_LOCAL,         
  1752.   LOC_TYPEDEF,         
  1753.  
  1754.  
  1755.   LOC_LABEL,         
  1756.   LOC_BLOCK,         
  1757.  
  1758.   LOC_EXTERNAL,         
  1759.  
  1760.  
  1761.  
  1762.  
  1763.   LOC_CONST_BYTES     
  1764. };
  1765.  
  1766. struct symbol
  1767. {
  1768.    
  1769.   char *name;
  1770.    
  1771.   enum namespace namespace;
  1772.    
  1773.   enum address_class class;
  1774.    
  1775.   struct type *type;
  1776.    
  1777.  
  1778.   union
  1779.     {
  1780.       long value;
  1781.       struct block *block;       
  1782.       char *bytes;         
  1783.     }
  1784.   value;
  1785. };
  1786.  
  1787. struct partial_symbol
  1788. {
  1789.    
  1790.   char *name;
  1791.    
  1792.   enum namespace namespace;
  1793.    
  1794.   enum address_class class;
  1795.    
  1796.  
  1797.  
  1798.  
  1799.  
  1800.   union
  1801.     {
  1802.       long value;
  1803.     }
  1804.   value;
  1805. };
  1806.  
  1807.  
  1808.  
  1809.  
  1810.  
  1811. extern struct psymbol_allocation_list {
  1812.   struct partial_symbol *list, *next;
  1813.   int size;
  1814. } global_psymbols, static_psymbols;
  1815.  
  1816.  
  1817.  
  1818.  
  1819.  
  1820.  
  1821. struct sourcevector
  1822. {
  1823.   int length;             
  1824.   struct source *source[1];     
  1825. };
  1826.  
  1827.  
  1828.  
  1829.  
  1830.  
  1831.  
  1832.  
  1833.  
  1834.  
  1835.  
  1836.  
  1837. struct linetable_entry
  1838. {
  1839.   int line;
  1840.   unsigned int  pc;
  1841. };
  1842.  
  1843. struct linetable
  1844. {
  1845.   int nitems;
  1846.   struct linetable_entry item[1];
  1847. };
  1848.  
  1849.  
  1850.  
  1851. struct source
  1852. {
  1853.   char *name;             
  1854.   struct linetable contents;
  1855. };
  1856. # 64 "symtab.h" 2
  1857.  
  1858.  
  1859.  
  1860.  
  1861.  
  1862. struct symtab
  1863.   {
  1864.      
  1865.     struct symtab *next;
  1866.      
  1867.     struct blockvector *blockvector;
  1868.      
  1869.     struct linetable *linetable;
  1870.      
  1871.     struct typevector *typevector;
  1872.      
  1873.     char *filename;
  1874.      
  1875.  
  1876.  
  1877.  
  1878.  
  1879.     enum free_code {free_nothing, free_contents, free_linetable}
  1880.       free_code;
  1881.      
  1882.     char *free_ptr;
  1883.      
  1884.     int nlines;
  1885.      
  1886.     int *line_charpos;
  1887.      
  1888.     enum language language;
  1889.      
  1890.     char *version;
  1891.      
  1892.     char *compilation;
  1893.      
  1894.  
  1895.     int ldsymoff;
  1896.      
  1897.  
  1898.     char *fullname;
  1899.   };
  1900.  
  1901.  
  1902.  
  1903.  
  1904.  
  1905.  
  1906.  
  1907. struct partial_symtab
  1908. {
  1909.    
  1910.   struct partial_symtab *next;
  1911.    
  1912.   char *filename;
  1913.    
  1914.  
  1915.  
  1916.  
  1917.  
  1918.  
  1919.  
  1920.   int ldsymoff, ldsymlen;
  1921.    
  1922.  
  1923.   int textlow, texthigh;
  1924.    
  1925.  
  1926.   unsigned char readin;
  1927.    
  1928.  
  1929.  
  1930.  
  1931.   struct partial_symtab **dependencies;
  1932.   int number_of_dependencies;
  1933.    
  1934.  
  1935.  
  1936.  
  1937.   int globals_offset, n_global_syms;
  1938.    
  1939.  
  1940.  
  1941.  
  1942.  
  1943.  
  1944.   int statics_offset, n_static_syms;
  1945. };
  1946.  
  1947.  
  1948.  
  1949. struct symtab *symtab_list;
  1950.  
  1951.  
  1952.  
  1953. struct partial_symtab *partial_symtab_list;
  1954.  
  1955.  
  1956.  
  1957. struct symtab *current_source_symtab;
  1958.  
  1959.  
  1960.  
  1961. int current_source_line;
  1962.  
  1963.  
  1964.  
  1965.  
  1966.  
  1967.  
  1968.  
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  
  1975.  
  1976.  
  1977.  
  1978.  
  1979.  
  1980.  
  1981.  
  1982.  
  1983.  
  1984.  
  1985.  
  1986.  
  1987.  
  1988.  
  1989.  
  1990.  
  1991.  
  1992.  
  1993.  
  1994.  
  1995.  
  1996.  
  1997.  
  1998.  
  1999.  
  2000.  
  2001.  
  2002.  
  2003.  
  2004.  
  2005.  
  2006.  
  2007.  
  2008.  
  2009.  
  2010.  
  2011.  
  2012.  
  2013.  
  2014.  
  2015.  
  2016.  
  2017.  
  2018.  
  2019.  
  2020.  
  2021.  
  2022.  
  2023.  
  2024.  
  2025.  
  2026.  
  2027.  
  2028.  
  2029.  
  2030.  
  2031.  
  2032.  
  2033.  
  2034.  
  2035.  
  2036.  
  2037.  
  2038.  
  2039.  
  2040.  
  2041.  
  2042.  
  2043.  
  2044.  
  2045.  
  2046.  
  2047.  
  2048.  
  2049.  
  2050.  
  2051.  
  2052.  
  2053.  
  2054.  
  2055.  
  2056.  
  2057.  
  2058.  
  2059.  
  2060.  
  2061.  
  2062.  
  2063.  
  2064.  
  2065.  
  2066.  
  2067.  
  2068.  
  2069.  
  2070.  
  2071.  
  2072.  
  2073.  
  2074.  
  2075.  
  2076.  
  2077. extern struct symtab *lookup_symtab ();
  2078. extern struct symbol *lookup_symbol ();
  2079. extern struct type *lookup_typename ();
  2080. extern struct type *lookup_unsigned_typename ();
  2081. extern struct type *lookup_struct ();
  2082. extern struct type *lookup_union ();
  2083. extern struct type *lookup_enum ();
  2084. extern struct type *lookup_struct_elt_type ();
  2085. extern struct type *lookup_pointer_type ();
  2086. extern struct type *lookup_function_type ();
  2087. extern struct type *lookup_basetype_type ();
  2088. extern struct type *create_array_type ();
  2089. extern struct symbol *block_function ();
  2090. extern struct symbol *find_pc_function ();
  2091. extern int find_pc_partial_function ();
  2092. extern struct partial_symtab *find_pc_psymtab ();
  2093. extern struct symtab *find_pc_symtab ();
  2094. extern struct partial_symbol *find_pc_psymbol ();
  2095. extern int find_pc_misc_function ();
  2096.  
  2097.  
  2098. extern struct type *lookup_reference_type ();
  2099. extern struct type *lookup_member_type ();
  2100. extern struct type *lookup_class ();
  2101.  
  2102.  
  2103. extern struct type *builtin_type_void;
  2104. extern struct type *builtin_type_char;
  2105. extern struct type *builtin_type_short;
  2106. extern struct type *builtin_type_int;
  2107. extern struct type *builtin_type_long;
  2108. extern struct type *builtin_type_unsigned_char;
  2109. extern struct type *builtin_type_unsigned_short;
  2110. extern struct type *builtin_type_unsigned_int;
  2111. extern struct type *builtin_type_unsigned_long;
  2112. extern struct type *builtin_type_float;
  2113. extern struct type *builtin_type_double;
  2114.  
  2115. # 334 "symtab.h"
  2116.  
  2117.  
  2118.  
  2119.  
  2120.  
  2121.  
  2122.  
  2123.  
  2124.  
  2125.  
  2126.  
  2127.  
  2128. struct symtab_and_line
  2129. {
  2130.   struct symtab *symtab;
  2131.   int line;
  2132.   unsigned int  pc;
  2133.   unsigned int  end;
  2134. };
  2135.  
  2136. struct symtabs_and_lines
  2137. {
  2138.   struct symtab_and_line *sals;
  2139.   int nelts;
  2140. };
  2141.  
  2142.  
  2143.  
  2144.  
  2145.  
  2146. struct symtab_and_line find_pc_line ();
  2147.  
  2148.  
  2149.  
  2150.  
  2151. struct symtabs_and_lines decode_line_spec ();
  2152. struct symtabs_and_lines decode_line_spec_1 ();
  2153. struct symtabs_and_lines decode_line_1 ();
  2154. # 122 "infrun.c" 2
  2155.  
  2156. # 1 "frame.h" 1
  2157.  
  2158.  
  2159.  
  2160.  
  2161.  
  2162.  
  2163.  
  2164.  
  2165.  
  2166.  
  2167.  
  2168.  
  2169.  
  2170.  
  2171.  
  2172.  
  2173.  
  2174.  
  2175.  
  2176.  
  2177.  
  2178.  
  2179.  
  2180.  
  2181.  
  2182.  
  2183.  
  2184.  
  2185.  
  2186.  
  2187.  
  2188.  
  2189.  
  2190.  
  2191.  
  2192.  
  2193.  
  2194.  
  2195.  
  2196.  
  2197.  
  2198.  
  2199.  
  2200. typedef struct frame_info *FRAME;
  2201. typedef unsigned int     FRAME_ADDR;
  2202.  
  2203.  
  2204.  
  2205.  
  2206.  
  2207.  
  2208.  
  2209.  
  2210.  
  2211.  
  2212.  
  2213.  
  2214. struct frame_info
  2215.   {
  2216.      
  2217.     FRAME_ADDR frame;
  2218.      
  2219.  
  2220.  
  2221.     unsigned int  pc;
  2222.      
  2223.  
  2224.  
  2225.  
  2226.     FRAME_ADDR next_frame;
  2227.      
  2228.  
  2229.  
  2230.  
  2231.  
  2232.      
  2233.     FRAME next, prev;
  2234.   };
  2235.  
  2236.  
  2237.  
  2238. struct frame_saved_regs
  2239.   {
  2240.      
  2241.  
  2242.     unsigned int  regs[18 ];
  2243.   };
  2244.  
  2245.  
  2246.  
  2247.  
  2248. extern FRAME selected_frame;
  2249.  
  2250. extern struct frame_info *get_frame_info ();
  2251. extern struct frame_info *get_prev_frame_info ();
  2252.  
  2253. extern FRAME create_new_frame ();
  2254.  
  2255. extern void get_frame_saved_regs ();
  2256.  
  2257. extern FRAME get_prev_frame ();
  2258. extern FRAME get_current_frame ();
  2259. extern FRAME get_next_frame ();
  2260.  
  2261. extern struct block *get_frame_block ();
  2262. extern struct block *get_current_block ();
  2263. extern struct block *get_selected_block ();
  2264. extern struct symbol *get_frame_function ();
  2265. extern struct symbol *get_pc_function ();
  2266.  
  2267.  
  2268. extern FRAME find_relative_frame ();
  2269.  
  2270.  
  2271.  
  2272. # 123 "infrun.c" 2
  2273.  
  2274. # 1 "inferior.h" 1
  2275.  
  2276.  
  2277.  
  2278.  
  2279.  
  2280.  
  2281.  
  2282.  
  2283.  
  2284.  
  2285.  
  2286.  
  2287.  
  2288.  
  2289.  
  2290.  
  2291.  
  2292.  
  2293.  
  2294.  
  2295.  
  2296.  
  2297.  
  2298.  
  2299.  
  2300.  
  2301.  
  2302.  
  2303. struct inferior_status {
  2304.   int pc_changed;
  2305.   int stop_signal;
  2306.   int stop_pc;
  2307.   int stop_frame_address;
  2308.   int stop_breakpoint;
  2309.   int stop_step;
  2310.   int stop_stack_dummy;
  2311.   int stopped_by_random_signal;
  2312.   int trap_expected;
  2313.   unsigned int  step_range_start;
  2314.   unsigned int  step_range_end;
  2315.   FRAME_ADDR step_frame_address;
  2316.   int step_over_calls;
  2317.   unsigned int  step_resume_break_address;
  2318.   int stop_after_trap;
  2319.   int stop_after_attach;
  2320.   FRAME_ADDR selected_frame_address;
  2321.   int selected_level;
  2322.   struct command_line *breakpoint_commands;
  2323.   char stop_registers[(16*4+8) ];
  2324.   int restore_stack_info;
  2325. };
  2326.  
  2327. void save_inferior_status (), restore_inferior_status ();
  2328.  
  2329.  
  2330.  
  2331. extern char *inferior_io_terminal;
  2332.  
  2333.  
  2334.  
  2335. extern int inferior_pid;
  2336.  
  2337.  
  2338. extern int remote_debugging;
  2339.  
  2340.  
  2341. int remote_read_inferior_memory ();
  2342. int remote_write_inferior_memory ();
  2343.  
  2344.  
  2345.  
  2346. extern int stop_signal;
  2347.  
  2348.  
  2349.  
  2350. extern unsigned int  stop_pc;
  2351.  
  2352.  
  2353.  
  2354. extern FRAME_ADDR stop_frame_address;
  2355.  
  2356.  
  2357.  
  2358. extern int stop_breakpoint;
  2359.  
  2360.  
  2361.  
  2362. extern int stop_step;
  2363.  
  2364.  
  2365.  
  2366. extern int stop_stack_dummy;
  2367.  
  2368.  
  2369.  
  2370.  
  2371. extern int stopped_by_random_signal;
  2372.  
  2373.  
  2374.  
  2375.  
  2376.  
  2377. extern unsigned int  step_range_start;  
  2378. extern unsigned int  step_range_end;  
  2379.  
  2380.  
  2381.  
  2382.  
  2383.  
  2384. extern FRAME_ADDR step_frame_address;
  2385.  
  2386.  
  2387.  
  2388.  
  2389. extern int step_over_calls;
  2390.  
  2391.  
  2392.  
  2393.  
  2394.  
  2395. extern int step_multi;
  2396.  
  2397.  
  2398.  
  2399. extern char stop_registers[(16*4+8) ];
  2400.  
  2401.  
  2402.  
  2403.  
  2404. extern int pc_changed;
  2405.  
  2406. long read_memory_integer ();
  2407. # 124 "infrun.c" 2
  2408.  
  2409. # 1 "wait.h" 1
  2410.  
  2411.  
  2412.  
  2413.  
  2414.  
  2415.  
  2416.  
  2417.  
  2418.  
  2419.  
  2420.  
  2421.  
  2422.  
  2423.  
  2424.  
  2425.  
  2426. # 27 "wait.h"
  2427.  
  2428. # 125 "infrun.c" 2
  2429.  
  2430.  
  2431. # 1 "u:\\c\\gnu\\include\\signal.h" 1
  2432.  
  2433.  
  2434.  
  2435.  
  2436.  
  2437.  
  2438.  
  2439.  
  2440.  
  2441.  
  2442.  
  2443.  
  2444.  
  2445.  
  2446.  
  2447.  
  2448.  
  2449.  
  2450.  
  2451.  
  2452.  
  2453.  
  2454.  
  2455.  
  2456.  
  2457.  
  2458.  
  2459.  
  2460.  
  2461.  
  2462.  
  2463.  
  2464.  
  2465.  
  2466.  
  2467.  
  2468.  
  2469.  
  2470.  
  2471.  
  2472.  
  2473.  
  2474.  
  2475.  
  2476.  
  2477.  
  2478.  
  2479.  
  2480.  
  2481. typedef void   (*__Sigfunc) (int signum) ;
  2482. typedef short sig_atomic_t;
  2483.  
  2484.  
  2485.  
  2486.  
  2487.  
  2488.   __Sigfunc    signal    (int sig, __Sigfunc func) ;
  2489.   int        raise    (int sig) ;
  2490.  
  2491.  
  2492.  
  2493. struct sigaction {
  2494.     __Sigfunc    sa_handler;     
  2495.     long        sa_mask;     
  2496.  
  2497.     int         sa_flags;     
  2498.  
  2499.  
  2500. };
  2501.  
  2502.   long    sigsetmask (long mask) ;
  2503.   long    sigblock   (long mask) ;
  2504.   int    sigaction  (int, const struct sigaction *,
  2505.                 struct sigaction *) ;
  2506.  
  2507.  
  2508.  
  2509.  
  2510.  
  2511.  
  2512.  
  2513.  
  2514.  
  2515.  
  2516. # 127 "infrun.c" 2
  2517.  
  2518.  
  2519.  
  2520.  
  2521.  
  2522.  
  2523. # 1 "u:\\c\\gnu\\include\\sys/file.h" 1
  2524.  
  2525.  
  2526.  
  2527. # 1 "u:\\c\\gnu\\include\\file.h" 1
  2528.  
  2529.  
  2530.  
  2531.  
  2532.  
  2533.  
  2534.  
  2535.  
  2536.  
  2537.  
  2538.  
  2539.  
  2540.  
  2541.  
  2542.   int        flock    (int, int) ;
  2543.  
  2544.  
  2545. # 1 "u:\\c\\gnu\\include\\fcntl.h" 1
  2546.  
  2547.  
  2548.  
  2549.  
  2550.  
  2551.  
  2552.  
  2553.  
  2554.  
  2555.  
  2556.  
  2557.  
  2558.  
  2559.  
  2560.  
  2561.  
  2562.  
  2563.  
  2564.  
  2565.  
  2566.  
  2567.  
  2568.  
  2569.  
  2570.  
  2571.  
  2572.  
  2573.  
  2574.  
  2575.  
  2576.  
  2577.  
  2578.  
  2579.  
  2580.  
  2581.  
  2582.  
  2583.  
  2584.  
  2585.  
  2586.  
  2587.  
  2588.  
  2589.  
  2590.  
  2591.  
  2592.  
  2593.  
  2594.  
  2595.  
  2596.  
  2597.  
  2598.  
  2599.  
  2600.  
  2601.  
  2602.  
  2603.  
  2604.  
  2605.  
  2606.  
  2607.  
  2608.  
  2609.  
  2610. struct flock {
  2611.     short l_type;
  2612.  
  2613.  
  2614.  
  2615.     short l_whence;
  2616.     long l_start;
  2617.     long l_len;
  2618.     short l_pid;
  2619. };
  2620.  
  2621.  
  2622.  
  2623.  
  2624.  
  2625.  
  2626.  
  2627. struct __open_file {
  2628.     short    status;         
  2629.     short    flags;         
  2630. };
  2631.  
  2632. # 99 "u:\\c\\gnu\\include\\fcntl.h"
  2633.  
  2634.  
  2635. extern struct __open_file __open_stat[40 ];
  2636.    
  2637.  
  2638.  
  2639.  
  2640.  
  2641.  
  2642.  
  2643.  
  2644.  
  2645.  
  2646.  
  2647.  
  2648.  
  2649.  
  2650.  
  2651.  
  2652.  
  2653.  
  2654.  
  2655.  
  2656.   int fcntl (int f, int cmd, ...) ;
  2657.  
  2658.  
  2659.  
  2660.  
  2661.  
  2662.  
  2663. # 18 "u:\\c\\gnu\\include\\file.h" 2
  2664.  
  2665.  
  2666.  
  2667. # 4 "u:\\c\\gnu\\include\\sys/file.h" 2
  2668.  
  2669.  
  2670.  
  2671. # 133 "infrun.c" 2
  2672.  
  2673.  
  2674.  
  2675.  
  2676.  
  2677.  
  2678.  
  2679.  
  2680.  
  2681.  
  2682. # 1 "u:\\c\\gnu\\include\\sys/types.h" 1
  2683.  
  2684.  
  2685.  
  2686. # 1 "u:\\c\\gnu\\include\\types.h" 1
  2687.  
  2688.  
  2689.  
  2690.  
  2691.  
  2692.  
  2693.  
  2694.  
  2695.  
  2696.  
  2697.  
  2698.  
  2699.  
  2700.  
  2701.  
  2702.  
  2703.  
  2704.  
  2705. typedef long  time_t;
  2706.  
  2707.  
  2708. typedef long off_t;
  2709.  
  2710. typedef unsigned char    u_char;
  2711. typedef unsigned short    u_short;
  2712. typedef unsigned long    u_long;
  2713.  
  2714. typedef unsigned short    dev_t;         
  2715.  
  2716.  
  2717.  
  2718. typedef u_long        ino_t;         
  2719. typedef unsigned short         uid_t;         
  2720. typedef unsigned short         gid_t;         
  2721. typedef int         pid_t;         
  2722. typedef void *        caddr_t;
  2723.  
  2724. # 1 "u:\\c\\gnu\\include\\utime.h" 1
  2725.  
  2726.  
  2727.  
  2728. struct utimbuf {             
  2729.     time_t    actime;
  2730.     time_t    modtime;
  2731. };
  2732.  
  2733.  
  2734. # 38 "u:\\c\\gnu\\include\\types.h" 2
  2735.  
  2736.  
  2737.  
  2738.  
  2739.  
  2740.  
  2741.  
  2742. # 4 "u:\\c\\gnu\\include\\sys/types.h" 2
  2743.  
  2744.  
  2745.  
  2746. # 143 "infrun.c" 2
  2747.  
  2748.  
  2749. # 1 "u:\\c\\gnu\\include\\sys/dir.h" 1
  2750.  
  2751.  
  2752.  
  2753.  
  2754.  
  2755.  
  2756.  
  2757.  
  2758.  
  2759.  
  2760.  
  2761.  
  2762.  
  2763.  
  2764.  
  2765.  
  2766. # 1 "u:\\c\\gnu\\include\\dirent.h" 1
  2767.  
  2768.  
  2769.  
  2770.  
  2771.  
  2772.  
  2773.  
  2774.  
  2775.  
  2776.  
  2777.  
  2778.  
  2779.  
  2780.  
  2781. # 1 "u:\\c\\gnu\\include\\limits.h" 1
  2782.  
  2783.  
  2784.  
  2785.  
  2786.  
  2787.  
  2788.  
  2789.  
  2790.  
  2791.  
  2792.  
  2793.  
  2794.  
  2795.  
  2796.  
  2797.  
  2798.  
  2799.  
  2800.  
  2801.  
  2802.  
  2803.  
  2804.  
  2805.  
  2806.  
  2807.  
  2808.  
  2809.  
  2810.  
  2811.  
  2812.  
  2813.  
  2814.  
  2815.  
  2816.  
  2817.  
  2818.  
  2819.  
  2820.  
  2821.  
  2822.  
  2823.  
  2824.  
  2825.  
  2826.  
  2827.  
  2828.  
  2829.  
  2830.  
  2831.  
  2832.  
  2833.  
  2834.  
  2835.  
  2836.  
  2837.  
  2838.  
  2839.  
  2840.  
  2841.  
  2842.  
  2843.   
  2844.  
  2845.  
  2846.  
  2847.  
  2848.  
  2849.  
  2850.  
  2851.  
  2852.  
  2853.  
  2854.  
  2855.  
  2856.  
  2857.  
  2858.  
  2859.  
  2860.  
  2861.  
  2862.  
  2863.  
  2864.  
  2865.  
  2866.  
  2867.  
  2868.  
  2869.  
  2870.  
  2871.  
  2872.  
  2873.  
  2874.  
  2875.  
  2876.  
  2877.  
  2878.  
  2879.  
  2880.  
  2881.  
  2882.  
  2883.          
  2884.  
  2885.  
  2886.  
  2887.  
  2888.  
  2889.  
  2890.  
  2891.  
  2892.  
  2893.  
  2894.  
  2895.  
  2896.  
  2897.  
  2898.  
  2899.  
  2900.  
  2901.  
  2902.  
  2903.  
  2904.  
  2905. # 15 "u:\\c\\gnu\\include\\dirent.h" 2
  2906.  
  2907.  
  2908.  
  2909.  
  2910.  
  2911. # 1 "u:\\c\\gnu\\include\\ostruct.h" 1
  2912.  
  2913.  
  2914.  
  2915.  
  2916.  
  2917.  
  2918.  
  2919.  
  2920.  
  2921.  
  2922.  
  2923.  
  2924.  
  2925.  
  2926.  
  2927.  
  2928.  
  2929.  
  2930.  
  2931.  
  2932.  
  2933. typedef struct {
  2934.     long b_free;     
  2935.     long b_total;     
  2936.     long b_secsiz;     
  2937.     long b_clsiz;     
  2938. } _DISKINFO;
  2939.  
  2940.  
  2941. typedef struct {
  2942.   short time;
  2943.   short date;
  2944. } _DOSTIME;
  2945.  
  2946.  
  2947. typedef struct
  2948. {
  2949.         unsigned char maxlen;
  2950.         unsigned char actuallen;
  2951.         char    buffer[255];
  2952. } _CCONLINE;
  2953.  
  2954.  
  2955.  
  2956.  
  2957.  
  2958.  
  2959. typedef struct _dta {
  2960.     char         dta_buf[21];     
  2961.     char            dta_attribute;     
  2962.     unsigned short  dta_time;         
  2963.     unsigned short  dta_date;         
  2964.     long            dta_size;         
  2965.     char            dta_name[14];     
  2966. } _DTA;
  2967.  
  2968.  
  2969.  
  2970.  
  2971.  
  2972.  
  2973.  
  2974.  
  2975.  
  2976.  
  2977.  
  2978.  
  2979.  
  2980.  
  2981.  
  2982.  
  2983.  
  2984.  
  2985.  
  2986.  
  2987.  
  2988.  
  2989.  
  2990.  
  2991.  
  2992.  
  2993.  
  2994.  
  2995.  
  2996.  
  2997.  
  2998.  
  2999.  
  3000.  
  3001.  
  3002.  
  3003.  
  3004.  
  3005.  
  3006.  
  3007.  
  3008.  
  3009. typedef struct {
  3010.   short recsiz;          
  3011.   short clsiz;           
  3012.   short clsizb;          
  3013.   short rdlen;           
  3014.   short fsiz;            
  3015.   short fatrec;          
  3016.   short datrec;          
  3017.   short numcl;           
  3018.   short bflags;          
  3019. } _BPB;
  3020.  
  3021.  
  3022.  
  3023.  
  3024. typedef struct _md {
  3025.     struct _md    *md_next;     
  3026.     long     md_start;     
  3027.     long     md_length;     
  3028.     long     md_owner;     
  3029. } _MD;
  3030.  
  3031.  
  3032. typedef struct {
  3033.     _MD *mp_free;         
  3034.     _MD *mp_used;         
  3035.     _MD *mp_rover;         
  3036. } _MPB;
  3037.  
  3038.  
  3039.  
  3040.  
  3041.  
  3042.  
  3043.  
  3044.  
  3045.  
  3046.  
  3047.  
  3048.  
  3049.  
  3050.  
  3051.  
  3052. typedef struct {
  3053.     char    *ibuf;
  3054.     short   ibufsiz;
  3055.     short   ibufhd;
  3056.     short   ibuftl;
  3057.     short   ibuflow;
  3058.     short   ibufhi;
  3059. } _IOREC;
  3060.  
  3061.  
  3062. typedef struct {
  3063.     char    topmode;
  3064.     char    buttons;
  3065.     char    xparam;
  3066.     char    yparam;
  3067. } _PARAM;
  3068.  
  3069.  
  3070. typedef struct {
  3071.     void    (*midivec)    (void) ;
  3072.     void    (*vkbderr)    (void) ;
  3073.     void    (*vmiderr)    (void) ;
  3074.     void    (*statvec)    (void *) ;
  3075.     void    (*mousevec)    (void *) ;
  3076.     void    (*clockvec)    (void *) ;
  3077.     void    (*joyvec)    (void *) ;
  3078.     long    (*midisys)    (void) ;
  3079.     long    (*ikbdsys)    (void) ;
  3080.     char    kbstate;
  3081. } _KBDVECS;
  3082.  
  3083.  
  3084. typedef struct {
  3085.     void *unshift;     
  3086.     void *shift;     
  3087.     void *caps;         
  3088. } _KEYTAB;
  3089.  
  3090.  
  3091. typedef struct
  3092. {
  3093.         void    *pb_scrptr;
  3094.         int     pb_offset;
  3095.         int     pb_width;
  3096.         int     pb_height;
  3097.         int     pb_left;
  3098.         int     pb_right;
  3099.         int     pb_screz;
  3100.         int     pb_prrez;
  3101.         void    *pb_colptr;
  3102.         int     pb_prtype;
  3103.         int     pb_prport;
  3104.         void    *pb_mask;
  3105. } _PBDEF;
  3106.  
  3107.  
  3108.  
  3109.  
  3110.  
  3111.  
  3112. # 20 "u:\\c\\gnu\\include\\dirent.h" 2
  3113.  
  3114.  
  3115.  
  3116.  
  3117.  
  3118.  
  3119.  
  3120.  
  3121.  
  3122.  
  3123.  
  3124.  
  3125.  
  3126. struct dirent {
  3127.        long            d_ino;           
  3128.        off_t           d_off;           
  3129.        short           d_reclen;        
  3130.  
  3131.  
  3132.  
  3133.  
  3134.  
  3135.  
  3136.  
  3137.  
  3138.        char            d_name[    31 +1];
  3139.  
  3140. };
  3141.  
  3142. # 57 "u:\\c\\gnu\\include\\dirent.h"
  3143.  
  3144.  
  3145. typedef struct _DIR {
  3146.     short    status;         
  3147.  
  3148.  
  3149.  
  3150.     _DTA    dta;         
  3151.     char    *dirname;     
  3152.  
  3153.     struct dirent buf;     
  3154.     long    handle;         
  3155. } DIR;
  3156.  
  3157.  
  3158.  
  3159.  
  3160.  
  3161.  
  3162.  
  3163.  
  3164.  
  3165.  
  3166.  
  3167.  
  3168.  
  3169.  
  3170.  
  3171.  
  3172.  
  3173.  
  3174.   DIR *        opendir    (const char *dirname) ;
  3175.   struct dirent *readdir    (DIR *dirp) ;
  3176.   off_t        telldir (DIR *dirp) ;
  3177.   void        seekdir    (DIR *dirp, off_t loc) ;
  3178.   void        rewinddir (DIR *dirp) ;
  3179.   int        closedir  (DIR *dirp) ;
  3180.  
  3181.  
  3182.  
  3183.  
  3184.  
  3185.  
  3186. # 17 "u:\\c\\gnu\\include\\sys/dir.h" 2
  3187.  
  3188.  
  3189. # 145 "infrun.c" 2
  3190.  
  3191.  
  3192. # 1 "u:\\c\\gnu\\include\\sys/param.h" 1
  3193.  
  3194.  
  3195.  
  3196.  
  3197.  
  3198.  
  3199.  
  3200.  
  3201.  
  3202.  
  3203.  
  3204.  
  3205.  
  3206.  
  3207.  
  3208.  
  3209.  
  3210. # 147 "infrun.c" 2
  3211.  
  3212.  
  3213.  
  3214.  
  3215.  
  3216.  
  3217.  
  3218. extern char *sys_siglist[];
  3219. extern int errno;
  3220.  
  3221.  
  3222.  
  3223.  
  3224.  
  3225.  
  3226.  
  3227.  
  3228.  
  3229.  
  3230.  
  3231.  
  3232.  
  3233.  
  3234.  
  3235.  
  3236.  
  3237.  
  3238.  
  3239. static char signal_stop[    31        ];
  3240. static char signal_print[    31        ];
  3241. static char signal_program[    31        ];
  3242.  
  3243.  
  3244.  
  3245. static int breakpoints_inserted;
  3246.  
  3247.  
  3248.  
  3249. static struct symbol *step_start_function;
  3250.  
  3251.  
  3252.  
  3253. static char break_insn[] = {0x4e, 0x4f} ;
  3254.  
  3255.  
  3256.  
  3257. static unsigned int  step_resume_break_address;
  3258.  
  3259.  
  3260.  
  3261. static char step_resume_break_shadow[sizeof break_insn];
  3262.  
  3263.  
  3264.  
  3265.  
  3266. static int step_resume_break_duplicate;
  3267.  
  3268.  
  3269.  
  3270.  
  3271.  
  3272.  
  3273. static int trap_expected;
  3274.  
  3275.  
  3276.  
  3277.  
  3278.  
  3279. static int trap_expected_after_continue;
  3280.  
  3281.  
  3282.  
  3283.  
  3284. int stop_after_trap;
  3285.  
  3286.  
  3287.  
  3288. int stop_after_attach;
  3289.  
  3290.  
  3291.  
  3292.  
  3293. int pc_changed;
  3294.  
  3295.  
  3296.  
  3297. int remote_debugging;
  3298.  
  3299.  
  3300.  
  3301. char stop_registers[(16*4+8) ];
  3302.  
  3303.  
  3304.  
  3305. static int breakpoints_failed;
  3306.  
  3307.  
  3308.  
  3309. static int running_in_shell;
  3310.  
  3311.  
  3312.  
  3313. static int stop_print_frame;
  3314.  
  3315.  
  3316.  
  3317.  
  3318.  
  3319.  
  3320. static void insert_step_breakpoint ();
  3321. static void remove_step_breakpoint ();
  3322. static void wait_for_inferior ();
  3323. static void normal_stop ();
  3324.  
  3325.  
  3326.  
  3327.  
  3328.  
  3329. void
  3330. clear_proceed_status ()
  3331. {
  3332.   trap_expected = 0;
  3333.   step_range_start = 0;
  3334.   step_range_end = 0;
  3335.   step_frame_address = 0;
  3336.   step_over_calls = -1;
  3337.   step_resume_break_address = 0;
  3338.   stop_after_trap = 0;
  3339.   stop_after_attach = 0;
  3340.  
  3341.    
  3342.   clear_breakpoint_commands ();
  3343. }
  3344.  
  3345.  
  3346.  
  3347.  
  3348.  
  3349.  
  3350.  
  3351.  
  3352.  
  3353.  
  3354.  
  3355.  
  3356.  
  3357. void
  3358. proceed (addr, signal, step)
  3359.      unsigned int  addr;
  3360.      int signal;
  3361.      int step;
  3362. {
  3363.   int oneproc = 0;
  3364.  
  3365.   if (step > 0)
  3366.     step_start_function = find_pc_function (read_pc ());
  3367.   if (step < 0)
  3368.     stop_after_trap = 1;
  3369.  
  3370.   if (addr == -1)
  3371.     {
  3372.        
  3373.  
  3374.  
  3375.  
  3376.       if (!pc_changed && breakpoint_here_p (read_pc ()))
  3377.     oneproc = 1;
  3378.     }
  3379.   else
  3380.     {
  3381.       write_register (17        , addr);
  3382.  
  3383.  
  3384.  
  3385.     }
  3386.  
  3387.   if (trap_expected_after_continue)
  3388.     {
  3389.        
  3390.  
  3391.  
  3392.  
  3393.       oneproc = 1;
  3394.       trap_expected_after_continue = 0;
  3395.     }
  3396.  
  3397.   if (oneproc)
  3398.      
  3399.  
  3400.     trap_expected = 1;
  3401.   else
  3402.     {
  3403.       int temp = insert_breakpoints ();
  3404.       if (temp)
  3405.     {
  3406.       print_sys_errmsg ("ptrace", temp);
  3407.       error ("Cannot insert breakpoints.\nThe same program may be running in another process.");
  3408.  
  3409.     }
  3410.       breakpoints_inserted = 1;
  3411.     }
  3412.  
  3413.    
  3414.   terminal_inferior ();
  3415.  
  3416.   if (signal >= 0)
  3417.     stop_signal = signal;
  3418.    
  3419.  
  3420.   else if (stop_signal <     31         && !signal_program[stop_signal])
  3421.     stop_signal= 0;
  3422.  
  3423.    
  3424.   resume (oneproc || step, stop_signal);
  3425.  
  3426.    
  3427.  
  3428.  
  3429.   wait_for_inferior ();
  3430.   normal_stop ();
  3431. }
  3432.  
  3433.  
  3434.  
  3435.  
  3436. void
  3437. writing_pc (val)
  3438.      unsigned int  val;
  3439. {
  3440.   stop_pc = val;
  3441.   pc_changed = 1;
  3442. }
  3443.  
  3444.  
  3445.  
  3446.  
  3447.  
  3448.  
  3449. void
  3450. start_inferior ()
  3451. {
  3452.    
  3453.  
  3454.  
  3455.  
  3456.  
  3457.  
  3458.  
  3459.   trap_expected = 2;
  3460.  
  3461.  
  3462.   running_in_shell = 0;         
  3463.   trap_expected_after_continue = 0;
  3464.   breakpoints_inserted = 0;
  3465.   mark_breakpoints_out ();
  3466.  
  3467.    
  3468.  
  3469.   terminal_init_inferior ();
  3470.  
  3471.    
  3472.   terminal_inferior ();
  3473.  
  3474.   if (remote_debugging)
  3475.     {
  3476.       trap_expected = 0;
  3477.       fetch_inferior_registers();
  3478.       set_current_frame (create_new_frame (read_register (14        ),
  3479.                        read_pc ()));
  3480.       stop_frame_address = ((get_current_frame())->frame) ;
  3481.       inferior_pid = 3;
  3482.       if (insert_breakpoints())
  3483.     fatal("Can't insert breakpoints");
  3484.       breakpoints_inserted = 1;
  3485.       proceed(-1, -1, 0);
  3486.     }
  3487.   else
  3488.     {
  3489.       wait_for_inferior ();
  3490.       normal_stop ();
  3491.     }
  3492. }
  3493.  
  3494.  
  3495.  
  3496. void
  3497. start_remote ()
  3498. {
  3499.   clear_proceed_status ();
  3500.   running_in_shell = 0;
  3501.   trap_expected = 0;
  3502.   inferior_pid = 3;
  3503.   breakpoints_inserted = 0;
  3504.   mark_breakpoints_out ();
  3505.   wait_for_inferior ();
  3506.   normal_stop();
  3507. }
  3508.  
  3509.  
  3510.  
  3511.  
  3512.  
  3513.  
  3514. void
  3515. attach_program (pid)
  3516.      int pid;
  3517. {
  3518.   attach (pid);
  3519.   inferior_pid = pid;
  3520.  
  3521.   mark_breakpoints_out ();
  3522.   terminal_init_inferior ();
  3523.   clear_proceed_status ();
  3524.   stop_after_attach = 1;
  3525.    
  3526.   terminal_inferior ();
  3527.   wait_for_inferior ();
  3528.   normal_stop ();
  3529. }
  3530.  
  3531.  
  3532.  
  3533.  
  3534.  
  3535.  
  3536.  
  3537.  
  3538. static void
  3539. wait_for_inferior ()
  3540. {
  3541.   register int pid;
  3542.   int  w;
  3543.   unsigned int  pc;
  3544.   int tem;
  3545.   int another_trap;
  3546.   int random_signal;
  3547.   unsigned int  stop_sp, prev_sp;
  3548.   unsigned int  prev_func_start, stop_func_start;
  3549.   char *prev_func_name, *stop_func_name;
  3550.   unsigned int  prologue_pc;
  3551.   int stop_step_resume_break;
  3552.   unsigned int  step_resume_break_sp;
  3553.   int newmisc;
  3554.   int newfun_pc;
  3555.   struct symtab_and_line sal;
  3556.   int prev_pc;
  3557.   extern unsigned int  text_end;
  3558.   int remove_breakpoints_on_following_step = 0;
  3559.  
  3560.   prev_pc = read_pc ();
  3561.   (void) find_pc_partial_function (prev_pc, &prev_func_name,
  3562.                    &prev_func_start);
  3563.   prev_func_start += 0 ;
  3564.   prev_sp = read_register (15        );
  3565.  
  3566.   while (1)
  3567.     {
  3568.        
  3569.       pc_changed = 0;
  3570.       flush_cached_frames ();
  3571.  
  3572.       if (remote_debugging)
  3573.     remote_wait (&w);
  3574.       else
  3575.     {
  3576.  
  3577.  
  3578.  
  3579.  
  3580.  
  3581.  
  3582.     }
  3583.  
  3584.        
  3585.       if ((((w)&0377) == 0) )
  3586.     {
  3587.       terminal_ours_for_output ();
  3588.       if (((w) >> 8) )
  3589.         printf ("\nProgram exited with code 0%o.\n", ((w) >> 8) );
  3590.       else
  3591.         printf ("\nProgram exited normally.\n");
  3592.       fflush ((&_iob[1]) );
  3593.       inferior_died ();
  3594.  
  3595.  
  3596.  
  3597.       stop_print_frame = 0;
  3598.       break;
  3599.     }
  3600.       else if (!(((w)&0377) == 0177) )
  3601.     {
  3602.       kill_inferior ();
  3603.       stop_print_frame = 0;
  3604.       stop_signal = ((w) & 0177) ;
  3605.       terminal_ours_for_output ();
  3606.       printf ("\nProgram terminated with signal %d, %s\n",
  3607.           stop_signal,
  3608.           stop_signal <     31        
  3609.           ? sys_siglist[stop_signal]
  3610.           : "(undocumented)");
  3611.       printf ("The inferior process no longer exists.\n");
  3612.       fflush ((&_iob[1]) );
  3613.  
  3614.  
  3615.  
  3616.       break;
  3617.     }
  3618.       
  3619.  
  3620.  
  3621.  
  3622.  
  3623.       
  3624.       fetch_inferior_registers ();
  3625.       stop_pc = read_pc ();
  3626.       set_current_frame ( create_new_frame (read_register (14        ),
  3627.                         read_pc ()));
  3628.       
  3629.       stop_frame_address = ((get_current_frame ())->frame) ;
  3630.       stop_sp = read_register (15        );
  3631.       stop_func_start = 0;
  3632.       stop_func_name = 0;
  3633.        
  3634.  
  3635.       (void) find_pc_partial_function (stop_pc, &stop_func_name,
  3636.                        &stop_func_start);
  3637.       stop_func_start += 0 ;
  3638.       another_trap = 0;
  3639.       stop_breakpoint = 0;
  3640.       stop_step = 0;
  3641.       stop_stack_dummy = 0;
  3642.       stop_print_frame = 1;
  3643.       stop_step_resume_break = 0;
  3644.       random_signal = 0;
  3645.       stopped_by_random_signal = 0;
  3646.       breakpoints_failed = 0;
  3647.       
  3648.        
  3649.  
  3650.  
  3651.  
  3652.  
  3653.  
  3654.  
  3655.       
  3656.       stop_signal = ((w) >> 8) ;
  3657.       
  3658.        
  3659.  
  3660.  
  3661.  
  3662.  
  3663.  
  3664.       
  3665.       if (stop_signal ==     5        
  3666.       || (breakpoints_inserted &&
  3667.           (stop_signal ==     4        
  3668.            || stop_signal ==     7         ))
  3669.       || stop_after_attach)
  3670.     {
  3671.       if (stop_signal ==     5         && stop_after_trap)
  3672.         {
  3673.           stop_print_frame = 0;
  3674.           break;
  3675.         }
  3676.       if (stop_after_attach)
  3677.         break;
  3678.        
  3679.  
  3680.  
  3681.       if (stop_signal ==     5         && trap_expected)
  3682.         stop_breakpoint = 0;
  3683.       else
  3684.         {
  3685.            
  3686.  
  3687.            
  3688.  
  3689.  
  3690.  
  3691.  
  3692.  
  3693.           if (!(prev_pc != stop_pc - 2 
  3694.             && step_range_end && !step_resume_break_address))
  3695.  
  3696.         {
  3697.            
  3698.  
  3699.           if (stop_pc - 2 
  3700.               == step_resume_break_address)
  3701.             {
  3702.               stop_step_resume_break = 1;
  3703.               if (2 )
  3704.             {
  3705.               stop_pc -= 2 ;
  3706.               write_register (17        , stop_pc);
  3707.               pc_changed = 0;
  3708.             }
  3709.             }
  3710.           else
  3711.             {
  3712.               stop_breakpoint =
  3713.             breakpoint_stop_status (stop_pc, stop_frame_address);
  3714.                
  3715.  
  3716.               stop_print_frame = 1;
  3717.               if (stop_breakpoint && 2 )
  3718.             {
  3719.               stop_pc -= 2 ;
  3720.               write_register (17        , stop_pc);
  3721.  
  3722.  
  3723.  
  3724.               pc_changed = 0;
  3725.             }
  3726.             }
  3727.         }
  3728.         }
  3729.       
  3730.       if (stop_signal ==     5        )
  3731.         random_signal
  3732.           = !(stop_breakpoint || trap_expected
  3733.           || stop_step_resume_break
  3734.  
  3735.           || (stop_sp <  stop_pc
  3736.               && stop_pc <  stop_frame_address)
  3737.  
  3738.  
  3739.  
  3740.           || (step_range_end && !step_resume_break_address));
  3741.       else
  3742.         {
  3743.           random_signal
  3744.         = !(stop_breakpoint
  3745.             || stop_step_resume_break
  3746.  
  3747.  
  3748.  
  3749.  
  3750.             
  3751.             );
  3752.           if (!random_signal)
  3753.         stop_signal =     5        ;
  3754.         }
  3755.     }
  3756.       else
  3757.     random_signal = 1;
  3758.       
  3759.        
  3760.  
  3761.       
  3762.       if (random_signal
  3763.       && !(running_in_shell && stop_signal ==     11        ))
  3764.     {
  3765.        
  3766.       int printed = 0;
  3767.       
  3768.       stopped_by_random_signal = 1;
  3769.       
  3770.       if (stop_signal >=     31        
  3771.           || signal_print[stop_signal])
  3772.         {
  3773.           printed = 1;
  3774.           terminal_ours_for_output ();
  3775.           printf ("\nProgram received signal %d, %s\n",
  3776.               stop_signal,
  3777.               stop_signal <     31        
  3778.               ? sys_siglist[stop_signal]
  3779.               : "(undocumented)");
  3780.           fflush ((&_iob[1]) );
  3781.         }
  3782.       if (stop_signal >=     31        
  3783.           || signal_stop[stop_signal])
  3784.         break;
  3785.        
  3786.  
  3787.       else if (printed)
  3788.         terminal_inferior ();
  3789.     }
  3790.       
  3791.        
  3792.       
  3793.       if (!random_signal
  3794.       && (stop_breakpoint || stop_step_resume_break))
  3795.     {
  3796.        
  3797.       if (stop_breakpoint && stop_breakpoint != -1
  3798.           && stop_breakpoint != -0x1000001)
  3799.         {
  3800.            
  3801.  
  3802.  
  3803.           if ((stop_breakpoint > 0 ? stop_breakpoint :
  3804.            -stop_breakpoint)
  3805.           & 0x1000000)
  3806.         {
  3807.           stop_print_frame = 0;
  3808.           if (stop_breakpoint > 0)
  3809.             stop_breakpoint -= 0x1000000;
  3810.           else
  3811.             stop_breakpoint += 0x1000000;
  3812.         }
  3813.           break;
  3814.         }
  3815.        
  3816.  
  3817.  
  3818.  
  3819.  
  3820.  
  3821.  
  3822.  
  3823.  
  3824.  
  3825.  
  3826.  
  3827.  
  3828.  
  3829.  
  3830.  
  3831.  
  3832.       if (stop_step_resume_break
  3833.           && (step_frame_address == 0
  3834.           || (stop_frame_address == step_frame_address)))
  3835.         {
  3836.           remove_step_breakpoint ();
  3837.           step_resume_break_address = 0;
  3838.         }
  3839.        
  3840.  
  3841.       else
  3842.         {
  3843.           remove_breakpoints ();
  3844.           remove_step_breakpoint ();
  3845.           breakpoints_inserted = 0;
  3846.           another_trap = 1;
  3847.         }
  3848.       
  3849.        
  3850.  
  3851.  
  3852.  
  3853.  
  3854.     }
  3855.       
  3856.        
  3857.  
  3858.  
  3859.       if (stop_sp <  stop_pc
  3860.       && stop_pc <  stop_frame_address)
  3861.  
  3862.  
  3863.  
  3864.       {
  3865.         stop_print_frame = 0;
  3866.         stop_stack_dummy = 1;
  3867.  
  3868.  
  3869.  
  3870.         break;
  3871.       }
  3872.       
  3873.       if (step_resume_break_address)
  3874.      
  3875.  
  3876.  
  3877.     ;
  3878.        
  3879.       else if (!random_signal
  3880.            && step_range_end
  3881.            && stop_pc >= step_range_start
  3882.            && stop_pc < step_range_end
  3883.             
  3884.  
  3885.  
  3886.  
  3887.            && !(stop_pc == step_range_start
  3888.             && stop_frame_address
  3889.             && (stop_sp <  prev_sp
  3890.             || stop_frame_address != step_frame_address)))
  3891.     {
  3892.        
  3893.  
  3894.       if ((read_memory_integer (stop_pc, 2) == 0x4e75) )
  3895.         {
  3896.           stop_step = 1;
  3897.           break;
  3898.         }
  3899.     }
  3900.       
  3901.        
  3902.  
  3903.       else if (!random_signal && step_range_end)
  3904.     {
  3905.       if (stop_func_start)
  3906.         {
  3907.           prologue_pc = stop_func_start;
  3908.           { register int op = read_memory_integer (prologue_pc, 2);    if (op == 0047126)    prologue_pc += 4; else if (op == 0044016)    prologue_pc += 6; } ;
  3909.         }
  3910.  
  3911.        
  3912.       if ( stop_func_name && !strcmp ("_sigtramp",  stop_func_name) 
  3913.           && ! prev_func_name && !strcmp ("_sigtramp",  prev_func_name) )
  3914.         {
  3915.            
  3916.  
  3917.  
  3918.            
  3919.  
  3920.           step_resume_break_address = prev_pc;
  3921.           step_resume_break_duplicate =
  3922.         breakpoint_here_p (step_resume_break_address);
  3923.           step_resume_break_sp = stop_sp;
  3924.           if (breakpoints_inserted)
  3925.         insert_step_breakpoint ();
  3926.            
  3927.  
  3928.           if (step_range_end == 1)
  3929.         step_range_end = (step_range_start = prev_pc) + 1;
  3930.           remove_breakpoints_on_following_step = 1;
  3931.         }
  3932.  
  3933.        
  3934.       
  3935.       else if (stop_pc == stop_func_start
  3936.           && (stop_func_start != prev_func_start
  3937.           || prologue_pc != stop_func_start
  3938.           || stop_sp != prev_sp))
  3939.         {
  3940.            
  3941.           if (step_over_calls > 0 
  3942.           || (step_over_calls &&  find_pc_function (stop_pc) == 0))
  3943.         {
  3944.            
  3945.            
  3946.           step_resume_break_address =
  3947.             read_memory_integer (read_register (15        ), 4) ;
  3948.           step_resume_break_duplicate
  3949.             = breakpoint_here_p (step_resume_break_address);
  3950.           step_resume_break_sp = stop_sp;
  3951.           if (breakpoints_inserted)
  3952.             insert_step_breakpoint ();
  3953.         }
  3954.            
  3955.  
  3956.           else if (step_over_calls)
  3957.         {
  3958.           { register int op = read_memory_integer (stop_func_start, 2);    if (op == 0047126)    stop_func_start += 4; else if (op == 0044016)    stop_func_start += 6; } ;
  3959.           sal = find_pc_line (stop_func_start, 0);
  3960.            
  3961.  
  3962.  
  3963.            
  3964.  
  3965.  
  3966.  
  3967.  
  3968.  
  3969.  
  3970.           if (sal.end && sal.pc != stop_func_start)
  3971.             stop_func_start = sal.end;
  3972.  
  3973.           
  3974.           if (stop_func_start == stop_pc)
  3975.             {
  3976.                
  3977.               stop_step = 1;
  3978.               break;
  3979.             }
  3980.           else
  3981.              
  3982.             {
  3983.               step_resume_break_address = stop_func_start;
  3984.               step_resume_break_sp = stop_sp;
  3985.               
  3986.               step_resume_break_duplicate
  3987.             = breakpoint_here_p (step_resume_break_address);
  3988.               if (breakpoints_inserted)
  3989.             insert_step_breakpoint ();
  3990.                
  3991.  
  3992.  
  3993.               step_frame_address = 0;
  3994.                
  3995.               step_range_end = step_range_start;
  3996.             }
  3997.         }
  3998.           else
  3999.         {
  4000.            
  4001.  
  4002.  
  4003.  
  4004.  
  4005.           stop_step = 1;
  4006.           break;
  4007.         }
  4008.         }
  4009.        
  4010.       else
  4011.         {
  4012.           stop_step = 1;
  4013.           break;
  4014.         }
  4015.     }
  4016.  
  4017.        
  4018.       prev_pc = read_pc ();     
  4019.       prev_func_start = stop_func_start;  
  4020.  
  4021.  
  4022.  
  4023.  
  4024.       prev_func_name = stop_func_name;
  4025.       prev_sp = stop_sp;
  4026.  
  4027.        
  4028.  
  4029.  
  4030.        
  4031.  
  4032.  
  4033.  
  4034.  
  4035.  
  4036.  
  4037.       if (trap_expected > 1)
  4038.     {
  4039.       trap_expected--;
  4040.       running_in_shell = 1;
  4041.       resume (0, 0);
  4042.     }
  4043.       else if (running_in_shell && stop_signal ==     11        )
  4044.     {
  4045.       resume (0,     11        );
  4046.     }
  4047.       else if (trap_expected && stop_signal !=     5        )
  4048.     {
  4049.        
  4050.  
  4051.  
  4052.       resume ((step_range_end && !step_resume_break_address)
  4053.           || trap_expected,
  4054.           stop_signal);
  4055.     }
  4056.       else
  4057.     {
  4058.        
  4059.  
  4060.  
  4061.  
  4062.       running_in_shell = 0;
  4063.        
  4064.  
  4065.       if (!step_resume_break_address &&
  4066.           remove_breakpoints_on_following_step)
  4067.         {
  4068.           remove_breakpoints_on_following_step = 0;
  4069.           remove_breakpoints ();
  4070.           breakpoints_inserted = 0;
  4071.         }
  4072.       else if (!breakpoints_inserted && !another_trap)
  4073.         {
  4074.           insert_step_breakpoint ();
  4075.           breakpoints_failed = insert_breakpoints ();
  4076.           if (breakpoints_failed)
  4077.         break;
  4078.           breakpoints_inserted = 1;
  4079.         }
  4080.  
  4081.       trap_expected = another_trap;
  4082.  
  4083.       if (stop_signal ==     5        )
  4084.         stop_signal = 0;
  4085.  
  4086.       resume ((step_range_end && !step_resume_break_address)
  4087.           || trap_expected,
  4088.           stop_signal);
  4089.     }
  4090.     }
  4091. }
  4092.  
  4093.  
  4094.  
  4095.  
  4096.  
  4097.  
  4098.  
  4099.  
  4100.  
  4101.  
  4102.  
  4103. static void
  4104. normal_stop ()
  4105. {
  4106.    
  4107.  
  4108.  
  4109.   if (inferior_pid)
  4110.     (get_current_frame ())->pc = read_pc ();
  4111.   
  4112.   if (breakpoints_failed)
  4113.     {
  4114.       terminal_ours_for_output ();
  4115.       print_sys_errmsg ("ptrace", breakpoints_failed);
  4116.       printf ("Stopped; cannot insert breakpoints.\nThe same program may be running in another process.\n");
  4117.  
  4118.     }
  4119.  
  4120.   if (inferior_pid)
  4121.     remove_step_breakpoint ();
  4122.  
  4123.   if (inferior_pid && breakpoints_inserted)
  4124.     if (remove_breakpoints ())
  4125.       {
  4126.     terminal_ours_for_output ();
  4127.     printf ("Cannot remove breakpoints because program is no longer writable.\nIt must be running in another process.\nFurther execution is probably impossible.\n");
  4128.  
  4129.  
  4130.       }
  4131.  
  4132.   breakpoints_inserted = 0;
  4133.  
  4134.    
  4135.  
  4136.  
  4137.   breakpoint_auto_delete (stop_breakpoint);
  4138.  
  4139.    
  4140.  
  4141.  
  4142.   if (stopped_by_random_signal)
  4143.     disable_current_display ();
  4144.  
  4145.   if (step_multi && stop_step)
  4146.     return;
  4147.  
  4148.   terminal_ours ();
  4149.  
  4150.   if (running_in_shell)
  4151.     {
  4152.       if (stop_signal ==     11        )
  4153.     {
  4154.       char *exec_file = (char *) get_exec_file (1);
  4155.  
  4156.       if (access (exec_file,         1 ) != 0)
  4157.         printf ("The file \"%s\" is not executable.\n", exec_file);
  4158.       else
  4159.          
  4160.  
  4161.  
  4162.  
  4163.  
  4164.         printf ("You have just encountered a bug in \"sh\".  GDB starts your program\nby running \"sh\" with a command to exec your program.\nThis is so that \"sh\" will process wildcards and I/O redirection.\nThis time, \"sh\" crashed.\n\nOne known bug in \"sh\" bites when the environment takes up a lot of space.\nTry \"info env\" to see the environment; then use \"delete env\" to kill\nsome variables whose values are large; then do \"run\" again.\n\nIf that works, you might want to put those \"delete env\" commands\ninto a \".gdbinit\" file in this directory so they will happen every time.\n");
  4165. # 1112 "infrun.c"
  4166.     }
  4167.        
  4168.       stop_print_frame = 0;
  4169.     }
  4170.  
  4171.   if (inferior_pid == 0)
  4172.     return;
  4173.  
  4174.    
  4175.  
  4176.   if (!stop_stack_dummy)
  4177.     {
  4178.       select_frame (get_current_frame (), 0);
  4179.  
  4180.       if (stop_print_frame)
  4181.     {
  4182.       if (stop_breakpoint > 0)
  4183.         printf ("\nBpt %d, ", stop_breakpoint);
  4184.       print_sel_frame (stop_step
  4185.                && step_frame_address == stop_frame_address
  4186.                && step_start_function == find_pc_function (stop_pc));
  4187.        
  4188.       do_displays ();
  4189.     }
  4190.     }
  4191.  
  4192.    
  4193.  
  4194.   read_register_bytes (0, stop_registers, (16*4+8) );
  4195.  
  4196.   if (stop_stack_dummy)
  4197.     {
  4198.        
  4199.  
  4200.  
  4201.       { register FRAME frame = get_current_frame ();    register unsigned int  fp;    register int regnum;    struct frame_saved_regs fsr;    struct frame_info *fi;    fi = get_frame_info (frame);    fp = fi->frame;    get_frame_saved_regs (fi, &fsr);    for (regnum = 14         - 1; regnum >= 0; regnum--)    if (fsr.regs[regnum])    write_register (regnum, read_memory_integer (fsr.regs[regnum], 4)); if (fsr.regs[16        ])    write_register (16        , read_memory_integer (fsr.regs[16        ], 4)); write_register (14        , read_memory_integer (fp, 4));    write_register (17        , read_memory_integer (fp + 4, 4)); write_register (15        , fp + 8);    flush_cached_frames ();    set_current_frame ( create_new_frame (read_register (14        ),    read_pc ())); } ;
  4202.       select_frame (get_current_frame (), 0);
  4203.     }
  4204. }
  4205.  
  4206. static void
  4207. insert_step_breakpoint ()
  4208. {
  4209.   if (step_resume_break_address && !step_resume_break_duplicate)
  4210.     {
  4211.       read_memory (step_resume_break_address,
  4212.            step_resume_break_shadow, sizeof break_insn);
  4213.       write_memory (step_resume_break_address,
  4214.             break_insn, sizeof break_insn);
  4215.     }
  4216. }
  4217.  
  4218. static void
  4219. remove_step_breakpoint ()
  4220. {
  4221.   if (step_resume_break_address && !step_resume_break_duplicate)
  4222.     write_memory (step_resume_break_address, step_resume_break_shadow,
  4223.           sizeof break_insn);
  4224. }
  4225.  
  4226.  
  4227.  
  4228. static void
  4229. handle_command (args, from_tty)
  4230.      char *args;
  4231.      int from_tty;
  4232. {
  4233.   register char *p = args;
  4234.   int signum = 0;
  4235.   register int digits, wordlen;
  4236.  
  4237.   if (!args)
  4238.     error_no_arg ("signal to handle");
  4239.  
  4240.   while (*p)
  4241.     {
  4242.        
  4243.       for (wordlen = 0; p[wordlen] && p[wordlen] != ' ' && p[wordlen] != '\t';
  4244.        wordlen++);
  4245.       for (digits = 0; p[digits] >= '0' && p[digits] <= '9'; digits++);
  4246.  
  4247.        
  4248.       if (digits == wordlen)
  4249.     {
  4250.       signum = atoi (p);
  4251.       if (signum <= 0 || signum >=     31        )
  4252.         {
  4253.           p[wordlen] = '\0';
  4254.           error ("Invalid signal %s given as argument to \"handle\".", p);
  4255.         }
  4256.       if (signum ==     5         || signum ==     2        )
  4257.         {
  4258.           if (!query ("Signal %d is used by the debugger.\nAre you sure you want to change it? ", signum))
  4259.         error ("Not confirmed.");
  4260.         }
  4261.     }
  4262.       else if (signum == 0)
  4263.     error ("First argument is not a signal number.");
  4264.  
  4265.        
  4266.  
  4267.       else if (!strncmp (p, "stop", wordlen))
  4268.     {
  4269.       signal_stop[signum] = 1;
  4270.       signal_print[signum] = 1;
  4271.     }
  4272.       else if (wordlen >= 2 && !strncmp (p, "print", wordlen))
  4273.     signal_print[signum] = 1;
  4274.       else if (wordlen >= 2 && !strncmp (p, "pass", wordlen))
  4275.     signal_program[signum] = 1;
  4276.       else if (!strncmp (p, "ignore", wordlen))
  4277.     signal_program[signum] = 0;
  4278.       else if (wordlen >= 3 && !strncmp (p, "nostop", wordlen))
  4279.     signal_stop[signum] = 0;
  4280.       else if (wordlen >= 4 && !strncmp (p, "noprint", wordlen))
  4281.     {
  4282.       signal_print[signum] = 0;
  4283.       signal_stop[signum] = 0;
  4284.     }
  4285.       else if (wordlen >= 4 && !strncmp (p, "nopass", wordlen))
  4286.     signal_program[signum] = 0;
  4287.       else if (wordlen >= 3 && !strncmp (p, "noignore", wordlen))
  4288.     signal_program[signum] = 1;
  4289.        
  4290.       else
  4291.     {
  4292.       p[wordlen] = 0;
  4293.       error ("Unrecognized flag word: \"%s\".", p);
  4294.     }
  4295.  
  4296.        
  4297.       p += wordlen;
  4298.       while (*p == ' ' || *p == '\t') p++;
  4299.     }
  4300.  
  4301.   if (from_tty)
  4302.     {
  4303.        
  4304.       printf ("Number\tStop\tPrint\tPass to program\tDescription\n");
  4305.       printf ("%d\t", signum);
  4306.       printf ("%s\t", signal_stop[signum] ? "Yes" : "No");
  4307.       printf ("%s\t", signal_print[signum] ? "Yes" : "No");
  4308.       printf ("%s\t\t", signal_program[signum] ? "Yes" : "No");
  4309.       printf ("%s\n", sys_siglist[signum]);
  4310.     }
  4311. }
  4312.  
  4313.  
  4314.  
  4315. static void
  4316. signals_info (signum_exp)
  4317.      char *signum_exp;
  4318. {
  4319.   register int i;
  4320.   printf_filtered ("Number\tStop\tPrint\tPass to program\tDescription\n");
  4321.  
  4322.   if (signum_exp)
  4323.     {
  4324.       i = parse_and_eval_address (signum_exp);
  4325.       if (i >=     31         || i < 0)
  4326.     error ("Signal number out of bounds.");
  4327.       printf_filtered ("%d\t", i);
  4328.       printf_filtered ("%s\t", signal_stop[i] ? "Yes" : "No");
  4329.       printf_filtered ("%s\t", signal_print[i] ? "Yes" : "No");
  4330.       printf_filtered ("%s\t\t", signal_program[i] ? "Yes" : "No");
  4331.       printf_filtered ("%s\n", sys_siglist[i]);
  4332.       return;
  4333.     }
  4334.  
  4335.   printf_filtered ("\n");
  4336.   for (i = 0; i <     31        ; i++)
  4337.     {
  4338.       { if (quit_flag) quit (); } ;
  4339.  
  4340.       printf_filtered ("%d\t", i);
  4341.       printf_filtered ("%s\t", signal_stop[i] ? "Yes" : "No");
  4342.       printf_filtered ("%s\t", signal_print[i] ? "Yes" : "No");
  4343.       printf_filtered ("%s\t\t", signal_program[i] ? "Yes" : "No");
  4344.       printf_filtered ("%s\n", sys_siglist[i]);
  4345.     }
  4346.  
  4347.   printf_filtered ("\nUse the \"handle\" command to change these tables.\n");
  4348. }
  4349.  
  4350.  
  4351.  
  4352.  
  4353.  
  4354. struct command_line *get_breakpoint_commands ();
  4355.  
  4356. void
  4357. save_inferior_status (inf_status, restore_stack_info)
  4358.      struct inferior_status *inf_status;
  4359.      int restore_stack_info;
  4360. {
  4361.   inf_status->pc_changed = pc_changed;
  4362.   inf_status->stop_signal = stop_signal;
  4363.   inf_status->stop_pc = stop_pc;
  4364.   inf_status->stop_frame_address = stop_frame_address;
  4365.   inf_status->stop_breakpoint = stop_breakpoint;
  4366.   inf_status->stop_step = stop_step;
  4367.   inf_status->stop_stack_dummy = stop_stack_dummy;
  4368.   inf_status->stopped_by_random_signal = stopped_by_random_signal;
  4369.   inf_status->trap_expected = trap_expected;
  4370.   inf_status->step_range_start = step_range_start;
  4371.   inf_status->step_range_end = step_range_end;
  4372.   inf_status->step_frame_address = step_frame_address;
  4373.   inf_status->step_over_calls = step_over_calls;
  4374.   inf_status->step_resume_break_address = step_resume_break_address;
  4375.   inf_status->stop_after_trap = stop_after_trap;
  4376.   inf_status->stop_after_attach = stop_after_attach;
  4377.   inf_status->breakpoint_commands = get_breakpoint_commands ();
  4378.   inf_status->restore_stack_info = restore_stack_info;
  4379.   
  4380.   bcopy (stop_registers, inf_status->stop_registers, (16*4+8) );
  4381.   
  4382.   record_selected_frame (&(inf_status->selected_frame_address),
  4383.              &(inf_status->selected_level));
  4384.   return;
  4385. }
  4386.  
  4387. void
  4388. restore_inferior_status (inf_status)
  4389.      struct inferior_status *inf_status;
  4390. {
  4391.   FRAME fid;
  4392.   int level = inf_status->selected_level;
  4393.  
  4394.   pc_changed = inf_status->pc_changed;
  4395.   stop_signal = inf_status->stop_signal;
  4396.   stop_pc = inf_status->stop_pc;
  4397.   stop_frame_address = inf_status->stop_frame_address;
  4398.   stop_breakpoint = inf_status->stop_breakpoint;
  4399.   stop_step = inf_status->stop_step;
  4400.   stop_stack_dummy = inf_status->stop_stack_dummy;
  4401.   stopped_by_random_signal = inf_status->stopped_by_random_signal;
  4402.   trap_expected = inf_status->trap_expected;
  4403.   step_range_start = inf_status->step_range_start;
  4404.   step_range_end = inf_status->step_range_end;
  4405.   step_frame_address = inf_status->step_frame_address;
  4406.   step_over_calls = inf_status->step_over_calls;
  4407.   step_resume_break_address = inf_status->step_resume_break_address;
  4408.   stop_after_trap = inf_status->stop_after_trap;
  4409.   stop_after_attach = inf_status->stop_after_attach;
  4410.   set_breakpoint_commands (inf_status->breakpoint_commands);
  4411.  
  4412.   bcopy (inf_status->stop_registers, stop_registers, (16*4+8) );
  4413.  
  4414.    
  4415.  
  4416.   if (have_inferior_p() && inf_status->restore_stack_info)
  4417.     {
  4418.       fid = find_relative_frame (get_current_frame (),
  4419.                  &level);
  4420.  
  4421.       if (fid == 0 ||
  4422.       ((fid)->frame)  != inf_status->selected_frame_address ||
  4423.       level != 0)
  4424.     {
  4425.        
  4426.  
  4427.  
  4428.  
  4429.  
  4430.  
  4431.  
  4432.       fprintf ((&_iob[2]) , "Unable to restore previously selected frame.\n");
  4433.       select_frame (get_current_frame (), 0);
  4434.       return;
  4435.     }
  4436.       
  4437.       select_frame (fid, inf_status->selected_level);
  4438.     }
  4439.   return;
  4440. }
  4441.  
  4442.  
  4443. void
  4444. _initialize_infrun ()
  4445. {
  4446.   register int i;
  4447.  
  4448.   add_info ("signals", signals_info,
  4449.         "What debugger does when program gets various signals.\nSpecify a signal number as argument to print info on that signal only.");
  4450.  
  4451.  
  4452.   add_com ("handle", class_run, handle_command,
  4453.        "Specify how to handle a signal.\nArgs are signal number followed by flags.\nFlags allowed are \"stop\", \"print\", \"pass\",\n \"nostop\", \"noprint\" or \"nopass\".\nPrint means print a message if this signal happens.\nStop means reenter debugger if this signal happens (implies print).\nPass means let program see this signal; otherwise program doesn't know.\nPass and Stop may be combined.");
  4454.  
  4455.  
  4456.  
  4457.  
  4458.  
  4459.  
  4460.  
  4461.  
  4462.   for (i = 0; i <     31        ; i++)
  4463.     {
  4464.       signal_stop[i] = 1;
  4465.       signal_print[i] = 1;
  4466.       signal_program[i] = 1;
  4467.     }
  4468.  
  4469.    
  4470.  
  4471.   signal_program[    5        ] = 0;
  4472.   signal_program[    2        ] = 0;
  4473.  
  4474.    
  4475.  
  4476.   signal_stop[    14        ] = 0;
  4477.   signal_print[    14        ] = 0;
  4478.  
  4479.  
  4480.   signal_stop[26        ] = 0;
  4481.   signal_print[26        ] = 0;
  4482.  
  4483.  
  4484.   signal_stop[    27        ] = 0;
  4485.   signal_print[    27        ] = 0;
  4486.  
  4487.  
  4488.   signal_stop[    20        ] = 0;
  4489.   signal_print[    20        ] = 0;
  4490.  
  4491.  
  4492.  
  4493.  
  4494.  
  4495.  
  4496.   signal_stop[    23        ] = 0;
  4497.   signal_print[    23        ] = 0;
  4498.  
  4499.  
  4500.   signal_stop[    16        ] = 0;
  4501.   signal_print[    16        ] = 0;
  4502.  
  4503. }
  4504.  
  4505.